package cn.iocoder.yudao.module.psy.dal.mysql.wxuser;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.psy.dal.dataobject.wxuser.WxUserDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.psy.controller.admin.wxuser.vo.*;

/**
 * 学生信息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface WxUserMapper extends BaseMapperX<WxUserDO> {

    default PageResult<WxUserDO> selectPage(WxUserPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WxUserDO>()
                .inIfPresent(WxUserDO::getDeptId, reqVO.getDeptIds())
                .eqIfPresent(WxUserDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(WxUserDO::getOpenId, reqVO.getOpenId())
                .eqIfPresent(WxUserDO::getUserId, reqVO.getUserId())
                .likeIfPresent(WxUserDO::getNickName, reqVO.getNickName())
                .eqIfPresent(WxUserDO::getPhone, reqVO.getPhone())
                .orderByDesc(WxUserDO::getId));
    }

}